package com.zhb.sys.shiro.role.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhb.sys.shiro.model.Role;
import com.zhb.sys.shiro.role.service.RoleService;
import com.zhb.sys.shiro.mapper.RoleMapper;
/**
 * Role服务实现。
 * 
 * @author zhb
 *
 */
@Service
public class RoleServiceImpl implements RoleService{

	@Autowired
	private RoleMapper roleMapper;
	@Override
	public List<Role> selectRoleByCondition(Role role) {
		return roleMapper.selectRoleByCondition(role);
	}
	@Override
	public int insert(Role role) {
		return roleMapper.insertSelective(role);
	}
	@Override
	public Role selectRoleById(String id) {
		return roleMapper.selectByPrimaryKey(id);
	}
	@Override
	public int update(Role role) {
		return roleMapper.updateByPrimaryKeySelective(role);
	}
	@Override
	public int delete(String id) {
		return roleMapper.deleteByPrimaryKey(id);
	}

}